<?php
	function p($arg){
		echo "<pre>";
			print_r($arg);
		echo "</pre>";
	}
	//读取与设置配置项
	function C($name=null,$value=null){
		static $config=array();
		if(is_null($name)){
			return $config;
		}
		if(is_array($name)){
			$config= array_merge($config,$name);
			return true;
		}
		if(is_string($name)){
			if(!is_null($value)){
				$config[$name]=$value;
			}else{
				return isset($config[$name])?$config[$name]:false;
			}
		}

	}
	function __autoload($className){
		$file = PATH_HD.'/bin/'.$className.'.class.php';
		if(is_file($file)){
			loadfile($file);
		}
	}
	//不重复加载文件
	function loadfile($file){
		static $files=array();
		$name = md5($file);
		if(isset($files[$name])){
			return true;
		}
		if(!is_file($file)|| !is_readable($file)){
			return false;
		}
		include $file;
		$files[$name]=true;
	}















?>